
var studentModel = require("../models/studentModel")
var classModel = require("../models/classModel")
module.exports={
    /**
 *   分页查询显示的数据
 * @param {*} currentPage  当前页数
 * @param {*} pageSize  每页显示多少条
 */
 async getstudentsbyPage({currentPage,pageSize}){
    
   return await studentModel.find()
                            .populate("classid")
                            .skip((currentPage-1)*pageSize)
                            .limit(pageSize)
                            .sort({"_id":-1}).exec();
 },
  async getTotalNums(){
     return await studentModel.countDocuments().exec();
  }

}